<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="/">
    <!-- 下拉框 -->
    <link rel="stylesheet" href="static/ace/css/chosen.css"/>

    <link href="plugins/kindeditor/themes/simple/simple.css" type="text/css" rel="stylesheet">
    <link href="plugins/kindeditor/themes/default/default.css" rel="stylesheet">
    <link href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
    <link href="static/styles/base.css" rel="stylesheet">
    <style>td {
        vertical-align: middle !important;
    }
    </style>
    <!-- jsp文件头和头部 -->
    <%@ include file="../index/top.jsp" %>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <form action="period/updateHTime.do" name="goodsForm" id="goodsForm" method="post">
                            <input type="hidden" name="timeId" value="${pd.timeId}"/>
                            <div id="zhongxin" style="padding-top: 13px;">
                                <table id="table_report2" class="table table-striped table-bordered table-hover">
                                    <c:if test="${time !=null && time !='' && time !='[]'}">
                                        <tbody class="harvest">
                                        <c:choose>
                                            <c:when test="${not empty time}">
                                                <c:forEach items="${time}" var="p" varStatus="vs">
                                                    <tr>
                                                        <td class="w100 tr">第${vs.index+1}阶段:</td>
                                                        <td>
                                                            <div class="container-fluid">
                                                                <div class="row">
                                                                    <div class="dib vm w200 ml10">
                                                                  		    通知会员时间:&emsp;
                                                                        <input type="text"
                                                                               class="form-control notifyDate"
                                                                               id="notify${vs.index}" name="notify"
                                                                               value="${p.notify_user_time }">
                                                                    </div>
                                                                    <div class="dib vm w200 ml10">
                                                                  		      地址修改截止时间:&emsp;
                                                                        <input type="text"
                                                                               class="form-control addressDate"
                                                                               id="address${vs.index}" name="address"
                                                                               value="${p.address_update_end_time }">
                                                                    </div>
                                                                    <div class="dib vm w200 ml10">
                                                                      	  实际收获时间:&emsp;
                                                                        <input type="text" class="form-control realDate"
                                                                               id="real${vs.index}" name="real"
                                                                               value="${p.real_harvest_time }">
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <%-- <input type="hidden"  name="hid" value="${p.id}"/>
                                                        	<input type="button" class="btnClass" value = "${vs.index }"/>  --%>
                                                        </td>
                                                    </tr>
                                                </c:forEach>
                                            </c:when>
                                        </c:choose>
                                        </tbody>
                                    </c:if>
                                    <tfoot>
                                    <tr>
                                        <td style="text-align: center;" colspan="10">
                                            <a class="btn btn-mini btn-primary" onclick="save();">保存</a>
                                            <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
                                        </td>
                                    </tr>
                                    </tfoot>
                                </table>
                            </div>
                            <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><img
                                    src="static/images/jiazai.gif"/><br/><h4 class="lighter block green"></h4></div>
                        </form>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <form action="">
    	<input type="hidden" name="notify">
    	<input type="hidden" name="address">
    	<input type="hidden" name="real">
    	
    </form>
    
    <!-- /.main-content -->
</div>
<!-- /.main-container -->
<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../index/foot.jsp" %>
<!-- ace scripts -->
<script src="static/ace/js/ace/ace.js"></script>
<!-- inline scripts related to this page -->
<script src="static/ace/js/bootbox.js"></script>
<!-- 下拉框 -->
<script src="static/ace/js/chosen.jquery.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript" src="static/js/common/file_upload.js"></script>
<script type="text/javascript" src="plugins/kindeditor/kindeditor-all.js"></script>
<script type="text/javascript" src="plugins/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" src="static/layDate-v5.0.9/laydate.js"></script>
<script type="text/javascript" src="static/js/provincial.municipal.league.js"></script>
</body>
<script type="text/javascript">
    $(top.hangge());
    //页面初始化完毕后执行此方法
    var dateArr = {notify: [], address: [], real: []}
    $('.notifyDate').add('.addressDate').add('.realDate').each(function (index, ele) {
        var id = '#' + ele.id
        var key = ele.id.slice(0, -1)
        dateArr[key].push(laydate.render(setDate(id)))
    })

    function setDate(id) {
        return {
            elem: id,
            format: 'yyyy-MM-dd HH:mm:ss',
            min: Date.now(),
            max: '2099-06-20',
            type: 'datetime',
            change: function (value, date, endDate) {
                var key = this.elem.selector.slice(1, -1)
                var index = this.elem.selector.slice(-1)
                var dateTime = dateArr[key][index].config.dateTime
            }

        }

    }


  /*   $(".btnClass").onclick(function(){
    	var $num=$(this).val();
     	var time =${time};
    	debugger
    	$.each(time,function ($num,t){
			var d=t;
			alert(d)
    	});
    	
    })
     */
    function save() {
    
    	
        $("#goodsForm").submit();
        $("#zhongxin").hide();
        $("#zhongxin2").show();
    }

</script>
</html>
